package cn.ltgodm.sandbox.test.writeCode;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Arrays;

/**
 * @author ltgodm
 * @date 2024-03-08 10:52:22
 * 植入危险程序
 */
public class Main {
    public static void main(String[] args) throws IOException {
        String dir = System.getProperty("user.dir");
        String path = dir + File.separator +"/src/main/resources/木马程序.bat";
        String errorProgram = "java -version 2>&1";
        Files.write(Paths.get(path), Arrays.asList(errorProgram));
        System.out.println("植入木马成功");
    }
}
